import Vue from 'vue/dist/vue.esm.js';
import App from './App.vue';
import Router from 'vue-router';
import routers from './router/router.js';
import './assets/css/css_reset.css';
import './assets/css/root.less';
import 'jquery.cookie';
import './common/common.js';
import stores from './store/vuex.js';

import './assets/iconAli/iconfont.css';
import './assets/iconAli/iconfont.js';

// import vueBeauty from 'vue-beauty';
import vueBeauty from './common/vue-beauty/vue-beauty.js';
import VueI18n from 'vue-i18n';
import Swiper from 'vue-awesome-swiper';
import vars from '../environment_variable.js';

Vue.use(Router);
Vue.use(vueBeauty);
Vue.use(Swiper);
Vue.use(VueI18n);

// VUE全局变量
const img_url = 'http://120.79.186.151:8080';
Vue.prototype.logo_text = 'GRINOK';
Vue.prototype.not_data = '暂无数据....';
Vue.prototype.img_url_appSource = img_url + '/grinok_source/app_source/';
Vue.prototype.img_url_web = img_url + '/grinok_source/home_source/';
Vue.prototype.related_pages = 'http://grinok.com:8081';
Vue.prototype.select_not_data = [{
    value: '0',
    label: '暂无数据'
}];
Vue.prototype.vars = vars;

// 多语言配置
const i18n = new VueI18n({
    locale: $.cookie('multilingual') || 'zh_CN',
    messages: {
        'zh_CN': require('./common/multilingual/zh_CN.js'),              // 中文语言包
        'en_US': require('./common/multilingual/en_US.js'),              // 英文语言包
    }
});

// 全局使用多语言
$.extend({ i18n_t: function (key) {
    return i18n.t(key);
}});

new Vue({
    router: routers,
    store: stores,
    i18n,
    render: h => h(App)
}).$mount('#app');
window.$ = jQuery;
